#pragma once

#include "znx_array.h"

// the hook chain is fifo.
// if the hook handle does not return true,
// the exec loop will break and the result will be returned.

typedef znx_bool_t (*znx_hook_handler_pt)(void *data);

typedef struct {
    znx_array_t             *arr;
} znx_hooks_t;

znx_hooks_t *znx_hooks_create();

void znx_hooks_destroy(znx_hooks_t *hooks);

void znx_hooks_add(znx_hooks_t *hooks, znx_hook_handler_pt handler);

znx_bool_t znx_hooks_exec(znx_hooks_t *hooks, void *data);

